<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org" xmlns:display="http://www.w3.org/1999/xhtml"
      xmlns:div.display="http://www.w3.org/1999/xhtml"
      xmlns:row.display="http://www.w3.org/1999/xhtml" lang="en">
<head>
    <meta charset="UTF-8">
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">

    <title>examination</title>

    <!-- Bootstrap Core CSS -->
    <link th:href="@{/vendor/bootstrap/css/bootstrap.min.css}" href="../static/vendor/bootstrap/css/bootstrap.min.css"
          rel="stylesheet">

    <link th:href="@{/vendor/metisMenu/metisMenu.min.css}" rel="stylesheet">

    <!-- Custom CSS -->
    <link th:href="@{/dist/css/sb-admin-2.css}" rel="stylesheet">

    <!-- Custom Fonts -->
    <link th:href="@{/vendor/font-awesome/css/font-awesome.min.css}" rel="stylesheet" type="text/css">
    <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>


<!-- Bootstrap Core JavaScript -->
    <script th:src="@{/vendor/jquery/jquery.min.js}" src="../../static/vendor/jquery/jquery.min.js"></script>
    <script th:src="@{/vendor/bootstrap/js/bootstrap.min.js}"></script>

    <!-- Metis Menu Plugin JavaScript -->
    <script th:src="@{/vendor/metisMenu/metisMenu.min.js}"></script>

    <!-- Custom Theme JavaScript -->
    <script th:src="@{/dist/js/sb-admin-2.js}"></script>
    <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
    <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
    <script type="text/javascript">
        function checkBoxChange() {
            var obj = document.getElementsByName('usersname');
            var s = '';
            for (var i = 0; i < obj.length; i++) {
                if (obj[i].checked) s += obj[i].value + ','; //如果选中，将value添加到变量s中
            }
            if (s.length > 0) {
                s = s.substring(0, s.length - 1);
                $("#actionUserName").val(s);
                $("#userCheck").val("选择已完成");
            }
            else {
                $("#actionUserName").val(s);
                $("#userCheck").val("请选择参会委员");
            }
        }

        function usersDelete() {
            if ($("#actionUserName").val != '') {
                $("#userCheck").val("请选择参会委员");
                $("#actionUserName").val('');
                var obj = document.getElementsByName('usersname');
                for (var i = 0; i < obj.length; i++) {
                    obj[i].checked = false;
                }
            }
        }
        function examinationSubmit() {
            $("#form_exam").submit();
            parent.location.reload();
        }
    </script>


</head>
<body>
<div id="examination">
    <div class="col-lg-12">
        <form name="applyInfo" th:action="@{/examination(userid=${uesrid},loanid=${loanid})}" method="post">
            <div class="panel panel-default">
                <div class="panel-heading">
                    <h4 class="panel-title">
                        <div class="row">
                            <div class="col-lg-6">
                                <a data-toggle="collapse" data-parent="#accordion" href="#collapseOne">工作流程记录</a>
                                <button type="submit" class="btn btn-primary">刷 新</button>
                                <button type="button" class="btn btn-primary">取消贷款</button>
                            </div>
                            <div class="col-lg-3">
                                <lable>当前步骤：审贷会审批贷款数据</lable>
                            </div>
                            <div class="col-lg-3">
                                <lable>工作流状态：运行中</lable>
                            </div>
                        </div>
                    </h4>


                </div>
                <div id="collapseOne" class="panel-collapse collapse in">
                    <div class="panel-body">
                        <div class="row">
                            <div class="tableinfo">
                                <table class="table" border="1">
                                    <tr>
                                        <th>日期</th>
                                        <th>用户</th>
                                        <th>步骤</th>
                                    </tr>
                                    <tr th:each="WorkFlow:${applyInfo_info.Workflow}">
                                        <td th:text="${WorkFlow.ACTIONDATE}"></td>
                                        <td th:text="${WorkFlow.ACTIONUSER}"></td>
                                        <td th:text="${WorkFlow.STEPCODE}"></td>
                                    </tr>
                                </table>
                            </div>

                        </div>


                    </div>
                </div>
            </div>


        </form>
    </div>
    <div class="col-lg-12">
        <form id="form_exam" th:action="@{/examination(loanid=${loanid},userid=${userid})}" th:object="${examination}"
              method="post">
            <div class="panel panel-default">
                <div class="panel-heading">
                    <h4 class="panel-title">
                        <div class="row">
                            <div class="col-lg-6">
                                <a data-toggle="collapse" data-parent="#accordion" href="#collapseTwo">审贷会审批</a>
                                <button type="button" class="btn btn-primary" onclick="examinationSubmit()">提 交</button>
                            </div>
                        </div>
                    </h4>


                </div>
                <div id="collapseTwo" class="panel-collapse collapse in">
                    <div class="panel-body">
                        <div class="row">
                            <div class="col-lg-2">
                                <label>当前处理银行：</label>
                            </div>
                            <div class="col-lg-2">
                                <input class="form-control" th:value="${branch}" disabled>
                                <!--th:field="*{AuditUserBankCode}"-->
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-lg-2">
                                <label>主状态：</label>
                            </div>
                            <div class="col-lg-2">
                                <input class="form-control" value="Application In Progress" disabled>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-lg-2">
                                <label>优先权：</label>
                            </div>
                            <div class="col-lg-2">
                                <select class="form-control" required>
                                    <option value="1">正常</option>
                                    <option value="2">最低</option>
                                    <option value="3">最高</option>
                                </select>
                            </div>
                        </div>

                        <br/><br/>

                        <lable style="color:blue">请录入申请信息</lable>
                        <br/>
                        <div class="row">
                            <div class="col-lg-2">
                                <label>审批序号：</label>
                            </div>
                            <div class="col-lg-2">
                                <input class="form-control" th:value="${puId}" disabled>
                                <!--th:field="AuditNo"-->
                            </div>
                        </div>

                        <div class="row">
                            <div class="col-lg-2">
                                <label>审批日期：</label>
                            </div>
                            <div class="col-lg-2">
                                <input class="form-control" th:value="自动生成" disabled>
                            </div>
                        </div>

                        <div class="row">
                            <div class="col-lg-2">
                                <label>审批会决议：</label>
                            </div>
                            <div class="col-lg-6">
                                <textarea class="form-control" th:field="*{WorkItemTitle}"></textarea>
                            </div>
                        </div>

                        <div class="row">
                            <div class="col-lg-2">
                                <label>重要备忘：</label>
                            </div>
                            <div class="col-lg-6">
                                <textarea class="form-control" th:field="*{AuditContext}"></textarea>
                            </div>
                        </div>

                        <div class="row">
                            <div class="col-lg-2">
                                <label>审批银行：</label>
                            </div>
                            <div class="col-lg-2">
                                <input class="form-control" th:value="${branch}">
                            </div>
                        </div>

                        <div class="row">
                            <div class="col-lg-2">
                                <label>参会委员：</label>
                            </div>
                            <div class="col-lg-2">
                                <input class="form-control" id="userCheck" th:value="请选择参会委员" disabled>
                            </div>
                            <div class="col-lg-2">
                                <button type="button" class="btn btn-default"><a data-toggle="modal"
                                                                                 data-target="#myModal">添加</a>
                                </button>
                                <button type="button" class="btn btn-default" onclick="usersDelete()">删除</button>


                            </div>


                        </div>

                        <div class="row">
                            <div class="col-lg-2">
                                <label>审批结果：</label>
                            </div>
                            <div class="col-lg-2">
                                <select class="form-control" th:field="*{Result}">
                                    <option disabled selected value>请选择</option>
                                    <option value="1">退回再议</option>
                                    <option value="2">拒绝</option>
                                    <option value="3">通过</option>
                                    <option value="4">额度审核通过</option>
                                    <option value="5">额度审核退回</option>
                                </select>
                            </div>
                        </div>

                    </div>
                </div>
            </div>
            <!-- 模态框（Modal） -->
            <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
                 aria-hidden="true">
                <div class="modal-dialog">
                    <div class="modal-content" style="width: 800px;height: 450px">
                        <div class="modal-header">
                            <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
                                &times;
                            </button>
                            <ul id="myshifang" class="nav nav-tabs">
                                <li class="active"><a href="#home" data-toggle="tab">银行用户</a></li>
                            </ul>
                        </div>
                        <div class="modal-body">
                            <div id="shifangxinxi" class="panel panel-default">
                                <div class="panel-heading">
                                    <h4 class="panel-title">
                                        <a data-toggle="collapse" data-parent="#accordion" href="#collapse21">选择参会委员</a>
                                    </h4>
                                </div>
                                <div id="collapse21" class="panel-collapse collapse in">
                                    <div class="panel-body">
                                        <div class="row">

                                            <!--<select class="form-control" selected="" id="InvestmentCurrency"  name="InvestmentCurrency" maxLength>-->
                                            <!--<option disabled selected value></option>-->
                                            <!--<option th:each="InvestmentCurrency:${users_info}" th:value="${InvestmentCurrency.userid}" th:text="${InvestmentCurrency.username}"></option>-->
                                            <!--</select>-->
                                            <input onchange="checkBoxChange()" name='usersname' type="checkbox"
                                                   th:each="InvestmentCurrency:${users_info}"
                                                   th:value="${InvestmentCurrency.userid}"
                                                   th:text="${InvestmentCurrency.userid}+'(审批金额:'+(${InvestmentCurrency.businesamoun}==null?'未输入':${InvestmentCurrency.businesamoun})+';用户实名:'+(${InvestmentCurrency.username}==null?'未输入':${InvestmentCurrency.username})+')'">
                                        </div>

                                        <div class="row">
                                            <input th:field="*{ActionUserName}" id="actionUserName">
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-primary" data-dismiss="modal">关闭</button>
                </div>
            </div><!-- /.modal-content -->
            <!-- /.modal -->


        </form>
    </div>

</div>

</body>
</html>